
package com.almori.hr.timetracker;

/**
 * Abstraction of an Employee it keep track of several fields and has mutators as well
 * Nov 26, 2012, 1:45:09 PM
 * @author gcastillo, nbenavidez
 */
public class Employee {
    private int id;
    private String fName;
    private String sName;
    private String lName;
    private String ced;
    private String status; // in or out
    private int id_dept;
    private String password;
    private String pic;
    private int role;
    private int lock;
    private Department department;
    
    
    /**
     * @return the id
     */
    
    public int getId() {
        return id;
    }

    /**
     * @return the fName
     */
    public String getfName() {
        return fName;
    }

    /**
     * @return the sName
     */
    public String getsName() {
        return sName;
    }

    /**
     * @return the lName
     */
    public String getlName() {
        return lName;
    }

    /**
     * @return the ced
     */
    public String getCed() {
        return ced;
    }

    /**
     * @return the status
     */
    public String getStatus() {
        return status;
    }

    /**
     * @return the id_dept
     */
    public int getId_dept() {
        return id_dept;
    }

    /**
     * @return the password
     */
    public String getPassword() {
        return password;
    }

    /**
     * @param id the id to set
     */
    public void setId(int id) {
        this.id = id;
    }

    /**
     * @param fName the fName to set
     */
    public void setfName(String fName) {
        this.fName = fName;
    }

    /**
     * @param sName the sName to set
     */
    public void setsName(String sName) {
        this.sName = sName;
    }

    /**
     * @param lName the lName to set
     */
    public void setlName(String lName) {
        this.lName = lName;
    }

    /**
     * @param ced the ced to set
     */
    public void setCed(String ced) {
        this.ced = ced;
    }

    /**
     * @param status the status to set
     */
    public void setStatus(String status) {
        this.status = status;
    }

    /**
     * @param id_dept the id_dept to set
     */
    public void setId_dept(int id_dept) {
        this.id_dept = id_dept;
    }

    /**
     * @param password the password to set
     */
    public void setPassword(String password) {
        this.password = password;
    }
    
    /**
     * @return the pic
     */
    public String getPic() {
        return pic;
    }

    /**
     * @param pic the pic to set
     */
    public void setPic(String pic) {
        this.pic = pic;
    }
   ////////////////////// Mutators 
    /**
     * Just grab the current status and tells you its inverse (IN or OUT)
     * @return Inverse Status
     */
    public String getInverseStatus()
    {
        if(this.status.equals("OUT"))
        {return "IN";}
        else
        {return "OUT";}        
    }
    
    /**
     * Just grab de current status and change it to its reverse (IN or OUT)
     * @return 
     */
    
    public void changeStatus()
    {
        if(this.status.equals("OUT"))
        {status = "IN";}
        else
        {status = "OUT";}
    }

    /**
     * @return the role
     */
    public int getRole() {
        return role;
    }

    /**
     * @param role the role to set
     */
    public void setRole(int role) {
        this.role = role;
    }
    
    public String getRoleDescription()
    {
        return (this.getRole() == 1)? "Agent":"Supervisor";
    }
    public String getDeptDesc()
    {
        return (this.getId_dept() == 1)? "PSI":"AppDev";
    }

    /**
     * @return the lock
     */
    public int getLock() {
        return lock;
    }

    /**
     * @param lock the lock to set
     */
    public void setLock(int lock) {
        this.lock = lock;
    }

    /**
     * @return the department
     */
    public Department getDepartment() {
        return department;
    }

    /**
     * @param department the department to set
     */
    public void setDepartment(Department department) {
        this.department = department;
    }
    
}// Employee
